package com.zzj.security.jwt.controller;

import com.zzj.security.jwt.entity.dto.HttpResult;
import com.zzj.security.jwt.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName SysRoleController
 * @Description TODO
 * @Author zhijun zeng at 1:09 2020/5/18
 * @Version 1.0
 **/
@RestController
@RequestMapping(value = "/ajax/admin/sysRole")
public class SysRoleController {

    @Autowired
    private SysRoleService sysRoleService;

    @RequestMapping(value = "")
    public HttpResult findAll() {
        return HttpResult.success().add(sysRoleService.findAll());
    }

    @RequestMapping(value = "/{roleId}")
    public HttpResult findById(@PathVariable(name = "roleId") Long roleId) {
        return HttpResult.success().add(sysRoleService.findById(roleId));
    }

}
